# -*- coding: utf-8 -*-
"""
Spyder Editor

This is a temporary script file.
"""
#猜数字游戏
import random

answer = random.randint(1,100)
counter = 0
while True:
    counter += 1
    number = int(input('请输入:'))
    if number < answer:
        print('大一点')
    elif number > answer:
        print('小一点')
    else:
        print('恭喜你猜对了！')
        break
print('你总共猜对了%d次' % counter)
if counter > 7:
        print('你的运气余额明显不足')
        
        
        
#输出乘法口诀表(九九表)        
for i in range(1, 10):
    for j in range(1, i + 1):
        print('%d * %d = %d' % (i, j, i * j), end='\t')
    print()
    
    
#判断素数  
n = int(input("输入一个正整数："))
yes= 1
for i in range(2,n):
    if n%i==0:
       yes=0
       break
if yes:
   print(n,'是素数')
else:
   print(n,'不是素数')
   
#打印三角形
row = int(input("请输入行数："))
for i_row in range(row):
    print(i_row,end = '')
    print('=')
print()

for i_row in range(row):
    for _i_row in range(i_row + 1):
        print('*',end = '')
        print()
print()

for i in range(row):
     for j in range(row):
         if j < row -i -1:
             print(' ', end = '')
         else:
             print('*', end = '')
     print()        